- /* getint.cpp by K.Tsuru */
- /****************
- integer type
- skip ' ' ',' '.' since version 2.30
- *****************/
- #include "getnum.h"
- #include <string>
- using namespace std;
-
- static const char* skipch = ",. ";
- static bool skip(char c) {
- return strchr(skipch, c) != NULL;
- }
- int GetInt(){
- string buff;
- char c;
- while(1) {
- if((c = getchar())== '\n') break;
- if(skip(c)) continue;
- buff.append(1, c);
- }
- return atoi(buff.c_str()); // There is stoi() in c++11?
- }
getint.cpp : last modifiled at 2017/02/26 15:44:54(492 bytes)
created at 2016/04/11 11:17:20
The creation time of this html file is 2017/10/07 10:54:15 (Sat Oct 07 10:54:15 2017).